﻿#include "TrChartTopBar.h"
#include "TrChartPeriodBar.h"
#include <QPalette>

TrChartTopBar::TrChartTopBar(QWidget *parent) : QWidget(parent)
{
    setFixedHeight(35);
    setStyleSheet("color:#d1d4dc;");
    setLayout(new QHBoxLayout);
    layout()->setMargin(0);
    layout()->setSpacing(3);

    setCode("ss2405");

    QLabel *pLableTitleName = new QLabel(m_stCode);
    pLableTitleName->setFixedWidth(180);
    pLableTitleName->setAutoFillBackground(true);
    pLableTitleName->setStyleSheet("QLabel{background:#151924; padding-left:10px;}");
    layout()->addWidget(pLableTitleName);
    m_pChartPeriodBar = new TrChartPeriodBar;
    layout()->addWidget(m_pChartPeriodBar);
    layout()->addWidget(new QWidget);
}

void TrChartTopBar::paintEvent(QPaintEvent* event)
{
    Q_UNUSED(event)

}

void TrChartTopBar::setCode(const QString& code)
{
    m_stCode = code;
}

TrChartPeriodBar* TrChartTopBar::getBarPtr()
{
    return m_pChartPeriodBar;
}
